package com.mpush.core.chat;

import com.mpush.api.chat.ChatMessageDto;
import com.mpush.netty.http.HttpCallback;
import io.netty.handler.codec.http.HttpResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class DefaultHttpCallback implements HttpCallback {

    private static final Logger LOGGER = LoggerFactory.getLogger(ChatMessageHttpCallback.class);

    @Override
    public void onResponse(HttpResponse response) {
        LOGGER.info("send request success end ,response={}", response);
    }

    @Override
    public void onFailure(int statusCode, String reasonPhrase) {
        LOGGER.warn("send request success end , response={}:{}", statusCode, reasonPhrase);
    }

    @Override
    public void onException(Throwable throwable) {
        LOGGER.error("send request success end , response={}, exception={}", 502, throwable);

    }

    @Override
    public void onTimeout() {
        LOGGER.warn("send request success end , response={}", 408);
    }

    @Override
    public boolean onRedirect(HttpResponse response) {
        return false;
    }

}
